<script setup>

const loading = ref(false)
const detail = ref(null)
const props = defineProps({
  // goPracticeMode: Function,
  // goExamMode: Function,
  onlyExamMode: {
    type: Boolean,
    default: false
  },
  recordsType: {
    type: String,
    default: ''
  }
})

function setDetail(val) {
  detail.value = val
}

function setLoading(val) {
  loading.value = val
}

defineExpose({
  setDetail,
  setLoading
})

</script>

<template>
  <div class="container" v-loading="loading">
    <template v-if="detail">
      <h1 class="examName">
        {{ detail.name }}
      </h1>
      <div class="examInfo-time-score">
        <div class="the-item1">
                    <span class="text">
                        考试总分
                    </span>
          <span>
                        {{ detail.totalScore || detail.allScore }}分
                    </span>
        </div>
        <div class="the-item1" v-if="detail.examTime">
                    <span class="text">
                        考试时长
                    </span>
          <span><span class="examTime-num">{{ detail.examTime }}</span>分钟</span>
        </div>
      </div>
      <div class="examInfo-total-count">
        <div class="the-item1">
                    <span class="text">
                        总题数
                    </span>
          <span>
                        {{ detail.qcount }}
                    </span>
        </div>


          <div class="the-item1">
                    <span class="text">
                    </span>
            <span class="people-num">{{ detail.stuCount || 0 }}人刷过</span>
          </div>


      </div>
      <div class="examInfo-total-count" v-if="recordsType=='paperRecordRandomFormPaper'">
        <div class="the-item1 remark">

          <span>
                        {{ detail.remark }}
                    </span>
        </div>
      </div>

      <div class="examInfo-question" v-else>
        <div v-for="item in detail.content" :key="item.tyName">
          <span>{{ item.tyName }}</span><span>共{{ item.qs.length }}题，{{
            item.qs.length ? item.qs[0].score : 0
          }}分/题</span>
        </div>
      </div>

    </template>
    <div v-else></div>

  </div>
</template>

<style scoped>
.container {
  width: 1000px;
  margin: 0 auto;

  padding-top: 30px;
  background-image: url('@/assets/images/exam-background.png');
  background-repeat: no-repeat;
  background-size: 100%;
  background-attachment: fixed;
  font-size: 24px;
}

.examName {
  text-align: center;
  font-size: 28px;
  font-weight: bolder;
  color: transparent;
  background-image: linear-gradient(180deg, #FFA500 35%, #FFD700 50%, #FFA500 65%);
  background-clip: text;
  animation: blink 2.0s infinite linear;
  text-shadow: 0 0 4px #FFD700;
}

@keyframes blink {
  0% {
    background-position: 0 0;
    text-shadow: 0 0 4px #FFA500;
  }
  50% {
    text-shadow: 0 0 4px #FFD700;
  }
  100% {
    background-position: 0px 100px;
    text-shadow: 0 0 4px #FFA500;
  }
}

.examInfo-time-score, .examInfo-total-count {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.the-item1 {
  display: flex;
  justify-content: space-between;
  width: 300px;
  align-items: center;
}
.the-item1.remark{
  width: 100%;
  justify-content: center;
}
.examInfo-question {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.examTime-num {
  color: rgba(255, 0, 0, 0.5);
}
</style>